/***********************************************************************************************//**
 * \file   hr.h
 * \brief  Heart Rate Service
 ***************************************************************************************************
 * <b> (C) Copyright 2015 Silicon Labs, http://www.silabs.com</b>
 ***************************************************************************************************
 * This file is licensed under the Silabs License Agreement. See the file
 * "Silabs_License_Agreement.txt" for details. Before using this software for
 * any purpose, you must agree to the terms of that agreement.
 **************************************************************************************************/

#ifndef HR_H
#define HR_H

#ifdef __cplusplus
extern "C" {
#endif

/***********************************************************************************************//**
 * \defgroup hr Heart Rate
 * \brief Heart Rate Service API
 **************************************************************************************************/

/***********************************************************************************************//**
 * @addtogroup Features
 * @{
 **************************************************************************************************/

/***********************************************************************************************//**
 * @addtogroup hr
 * @{
 **************************************************************************************************/


/***************************************************************************************************
  Public Macros and Definitions
***************************************************************************************************/

/***************************************************************************************************
  Function Declarations
***************************************************************************************************/

/***********************************************************************************************//**
 *  \brief  Initialise Heart Rate Service.
 *  \details  Initialise the connection ID, the configuration flags of the heart rate measurement
 *  and stop the heart rate measurement timer.
 **************************************************************************************************/
void hrInit(void);

/***********************************************************************************************//**
 *  \brief  Heart Rate CCCD has changed event handler function.
 *  \param[in]  connection  Connection ID.
 *  \param[in]  clientConfig  New value of CCCD.
 **************************************************************************************************/
void hrCharStatusChange(uint8_t connection, uint16_t clientConfig);

/***********************************************************************************************//**
 *  \brief  Make one heart rate measurement.
 **************************************************************************************************/
void hrMeasure(void);

/***********************************************************************************************//**
 *  \brief  Write request with new Heart Rate Control point.
 *  \param[in]  writeValue  Pointer to generic array holding written value.
***************************************************************************************************/
void hrWrite(uint8array *writeValue);


/** @} (end addtogroup hr) */
/** @} (end addtogroup Features) */

#ifdef __cplusplus
};
#endif

#endif /* HR_H */
